AST Specialisation and Partial Evaluation for Easy High-Performance Metaprogramming

نویسنده

  • Chris Seaton
چکیده

The Ruby programming language has extensive metaprogramming functionality. Unlike most similar languages, the use of these features is idiomatic and much of the Ruby ecosystem uses metaprogramming operations in the inner loops of libraries and applications. The foundational techniques to make most of these metaprogramming operations efficient have been known since the work on Smalltalk and Self, but their implementation in practice is difficult enough that they are not widely applied in existing implementations of Ruby and other similar languages. The Truffle framework for writing self-specialising AST interpreters, and the Graal dynamic compiler have been designed to make it easy to develop high-performance implementations of languages. We have found that the tools they provide also make it dramatically easier to implement efficient metaprogramming. In this paper we present metaprogramming patterns from Ruby, show that with Truffle and Graal their implementation can be easy, concise, elegant and highly performant, and highlight the key tools that were needed from them.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A self-applicable partial evaluator for the logic programming language Goedel

Partial evaluation is a program specialisation technique that has been shown to have great potential in logic programming, particularly for the specialisation of meta-interpreters by the so-called “Futamura Projections”. Meta-interpreters and other meta-programs are programs which use another program as data. In this thesis we describe a partial evaluator for meta-programs in the logic programm...

متن کامل

A quick and easy high performance liquid chromatography method for evaluation of cefixime in human plasma

Cefixime is essential member of orally energetic third generation cephalosporin and has tremendous activity aligned with many pathogens. The virtual bioavailability of a newly industrial dispersible tablet as compared with a recognized identified formulation.  A simple and available reversed-phase HPLC method with UV detection has been urbanized and validate for cefixime evaluate in human p...

متن کامل

Fully Automatic Binding-Time Analysis for Prolog

Offline partial evaluation techniques rely on an annotated version of the source program to control the specialisation process. These annotations guide the specialisation and ensure the termination of the partial evaluation. We present an algorithm for generating these annotations automatically. The algorithm uses state-of-the-art termination analysis techniques, combined with a new type-based ...

متن کامل

Under consideration for publication in Theory and Practice of Logic Programming 1 Logic program specialisation through

Program specialisation aims at improving the overall performance of programs by performing source to source transformations. A common approach within functional and logic programming, known respectively as partial evaluation and partial deduction, is to exploit partial knowledge about the input. It is achieved through a well-automated application of parts of the Burstall-Darlington unfold/fold ...

متن کامل

Embodied genomes and metaprogramming

We model some of the crucial properties of biological novelty generation, and abstract these out into minimal requirements for an ALife system that exhibits constant novelty generation (open ended evolution) combined with robustness. The requirements are an embodied genome that supports runtime metaprogramming (‘self modifying code’), generation of multiple behaviours expressible as interfaces,...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016